package com.inepex.inechart.client.linechart;

import java.util.ArrayList;

import com.inepex.inechart.shared.linechart.Curve;

class CurveModelContainer {

	protected final Curve curve;
	
	protected ArrayList<CurvePart> curveParts;

	public CurveModelContainer(Curve curve) {
		this.curve = curve;
		curveParts = new ArrayList<CurvePart>();
	}
	
	protected void addCurvePart(CurvePart curvePart){
		curveParts.add(curvePart);
	}
	
	public CurvePart getCurvePart(double from){
		for (CurvePart cp : curveParts) {
			if(cp.getFrom() == from){
				return cp;
			}
		}
		return null;
	}
}
